// src/utils/fingerprint.js
import FingerprintJS from "@fingerprintjs/fingerprintjs";

// 初始化并获取浏览器指纹
export const getFingerprint = async () => {
  try {
    const fp = await FingerprintJS.load();
    const result = await fp.get();
    return result.visitorId; // 返回唯一的 visitorId
  } catch (error) {
    console.error("Error generating fingerprint:", error);
    return null;
  }
};
